import request from "@/utils/request";

const api_name = '/video'

export default {
    // 添加课时
    addVideo(video) {
        return request({
            url: `${api_name}`,
            method: 'post',
            data: video
        })
    },
    // 根据id获取课时数据
    getVideo(id) {
        return request({
            url: `${api_name}/${id}`,
            method: 'get'
        })
    },
    // 更新课时数据
    updateVideo(video) {
        return request({
            url: `${api_name}/${video.id}`,
            method: 'put',
            data: video
        })
    },
    // 根据id删除课程小节
    delVideo(id) {
        return request({
            url: `${api_name}/${id}`,
            method: 'delete'
        })
    }
}